package com.portal.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.portal.entity.Carousel;
import com.portal.mapper.CarouselMapper;
import com.portal.service.CarouselService;
import org.springframework.stereotype.Service;
import java.util.List;

/**
 * 轮播图服务实现类
 */
@Service
public class CarouselServiceImpl extends ServiceImpl<CarouselMapper, Carousel> implements CarouselService {
    
    @Override
    public List<Carousel> getEnabledCarousels() {
        LambdaQueryWrapper<Carousel> wrapper = new LambdaQueryWrapper<>();
        wrapper.eq(Carousel::getEnabled, true)
               .orderByAsc(Carousel::getSort);
        return list(wrapper);
    }
} 